package io.seata.samples.sb.tccat.one.controller;

import io.seata.samples.sb.tccat.api.service.ActionOneService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * @author Administrator
 */
@RequiredArgsConstructor
@RestController
public class ActionOneController {
    private final ActionOneService actionOneService;

    @GetMapping("/prepare")
    public String prepare(@RequestParam(name = "param") String param) {
        return actionOneService.prepare(param);
    }

    @GetMapping("/commit")
    public String commit(@RequestParam(name = "param") String param) {
        return actionOneService.commit(param);
    }

    @GetMapping("/rollback")
    public String rollback(@RequestParam(name = "param") String param) {
        return actionOneService.rollback(param);
    }
}
